//
//  BanBu_ChatCellAPI.h
// Halfarea
//
//  Created by Wang Xj on 14-3-10.
//
//

#ifndef Koochat_BanBu_ChatCellAPI_h
#define Koochat_BanBu_ChatCellAPI_h
#import "BanBu_SmileLabel.h"
#import "UIImageView+WebCache.h"
#define CellMarge 10.0
#define ImageTypeHeight 100
#define VoiceTypeHeight 40
#define locationTypeHeight 80
#define TimeLabelHeight 24.0
#define FromLabelHeight 24.0
#define HintsLableHeight 40
#define VideoTypeHeight 120
#define SpecialViewHeight 150
#define FullScreenTypeHeight 80


#define SmileStr  @"[装可爱]|[睁大眼睛]|[阴谋得逞]|[压力好大]|[兴高采烈]|[太帅了]|[睡觉]|[求饶]|[求包养]|[俏皮]|[怒发冲冠]|[目瞪口呆]|[路过]|[泪流满面]|[可怜兮兮]|[害羞]|[歌舞王后]|[高歌一曲]|[发奋图强]|[嘟嘟嘴]|[大跌眼镜]|[打怪兽]|[吃包子]|[不同意]"

typedef enum
{
    MediaStatusNormal = 0,
    MediaStatusUpload,
    MediaStatusDownload,
    MediaStatusUploadFaild,
    MediaStatusDownloadFaild,
    MediaStatusReaded   //已播放过
} MediaStatus;

typedef enum {
    ChatStatusSendFail = 0,
    ChatStatusSent,
    ChatStatusSending,
    ChatStatusReaded,
    ChatStatusNone
} ChatStatus;

typedef enum {
    ChatCellTypeText = 0,
    ChatCellTypeImage,
    ChatCellTypeLocation,
    ChatCellTypeVoice,
    ChatCellTypeEmi,
    CHatCellTYpeHints,//特殊消息类型，显示提示信息，如：银行卡安全信息等
    ChatCellTypeVideo,   //视频
    ChatCellTypeFullScreenGif,//全屏播放的动画
    ChatCellTypeSpecialText //复文本消息：广播通知、动态通知、推荐好友、推荐游戏、推荐应用、第三方插件消息、网址
    
} ChatCellType;

typedef enum {
    ChatMsgSmileLabel = 0,
    ChatMsgMediaView,
    ChatMsgVoiceView,
    ChatMsgVideo
}ChatMsgType;//用户设置FromLable，不同消息类型FromLable的frame不同

typedef enum {
    ChatCellMsgFromMo = 0,
    ChatcellMsgFromPb,
    ChatcellMsgFromTy,
    ChatcellMsgFromHints,
    ChatCellMsgFromSnap,
    ChatcellMsgFromApp
}ChatCellMsgFrom;

#define MaxGIFWith 160

#define AvatarWidth 40.0

#define DefaultFont [UIFont systemFontOfSize:17]
#define Marge 10
#define MaxWidth 180
#define DefaultHeight [@"f" sizeWithFont:DefaultFont].height


#pragma marlk - 分拆chatcell后的宏

#define AvatarRect(height)  CGRectMake(_atLeft?10.0:(320-AvatarWidth-10.0),(_showTime?29:4), AvatarWidth, AvatarWidth)
#define AvatarRect01  CGRectMake(self.atLeft?10.0:(320-AvatarWidth-10.0),self.bkView.frame.origin.y+self.bkView.frame.size.height-AvatarWidth, AvatarWidth, AvatarWidth)
#define AvatarRect02  CGRectMake(self.atLeft?10.0:(320-AvatarWidth-10.0),self.bkView.frame.origin.y+self.bkView.frame.size.height-AvatarWidth-20, AvatarWidth, AvatarWidth)


#define BKViewRect(width,height)  CGRectMake(_atLeft?54.0:(320-width-69.0),(_showTime?(TimeLabelHeight+5):0)+(_showFrom?2:2), width+15, height-(_showTime?TimeLabelHeight:0)-(_showFrom?FromLabelHeight:0)+10)

#define BKViewRect00(width,height)  CGRectMake(self.atLeft?54.0:(320-width-69.0),(self.showTime?(TimeLabelHeight+5):0)+(self.showFrom?2:2), width+15, height-(self.showTime?TimeLabelHeight:0)-(self.showFrom?FromLabelHeight:0)+10)

#define BKViewRect01(width,height)  CGRectMake(self.atLeft?59.0:(320-width-74.0),(self.showTime?(TimeLabelHeight+5):0)+(self.showFrom?2:2), width+15, height+10)
#define BKViewRect02(width,height)  CGRectMake(self.atLeft?54.0:(320-width-69.0),(self.showTime?(TimeLabelHeight+5):0)+(self.showFrom?2:2), width+15, height+10)
#define BKViewRect03(width,height)  CGRectMake(self.atLeft?54.0:(320-width-69.0),(self.showTime?(TimeLabelHeight+5):0)+(self.showFrom?2:2), width+15, height-(self.showTime?TimeLabelHeight:0)-(self.showFrom?FromLabelHeight:0))

//为了解决UILabel的问题，瞎加的
#define SmileLabelRect00  CGRectMake(self.bkView.frame.origin.x+2+(self.atLeft?6.0:0.0)+12, self.bkView.frame.origin.y+(self.atLeft?2:1), self.bkView.frame.size.width-35, self.bkView.frame.size.height-10)

#define SmileLabelRect01  CGRectMake(self.bkView.frame.origin.x+2+(self.atLeft?2.0:4.0)+12, self.bkView.frame.origin.y+(self.atLeft?4:4), self.bkView.frame.size.width-35, self.bkView.frame.size.height-10)

#define SmileLabelRect02  CGRectMake(self.bkView.frame.origin.x+2+(self.atLeft?2.0:4.0)+12, self.bkView.frame.origin.y+(self.atLeft?6:6), self.bkView.frame.size.width-35, self.bkView.frame.size.height-10)


#define MediaViewRect00  CGRectMake(self.bkView.frame.origin.x+(self.atLeft?(12.0+7.5):(8.0+7)), self.bkView.frame.origin.y+7.0+3+(self.atLeft?.0:0), self.bkView.frame.size.width-30-5, self.bkView.frame.size.height-30)

#define MediaViewRect01  CGRectMake(self.bkView.frame.origin.x+(self.atLeft?(12.0+7.5):(8.0+7)), self.bkView.frame.origin.y+7.0+3+(self.atLeft?.0:0)+3, self.bkView.frame.size.width-30, self.bkView.frame.size.height-30)

#define MediaViewRect02  CGRectMake(self.bkView.frame.origin.x, self.bkView.frame.origin.y, self.bkView.frame.size.width, self.bkView.frame.size.height)

#define locationViewRext00  CGRectMake(self.bkView.frame.origin.x+(self.atLeft?14:11), self.bkView.frame.origin.y+6.0, self.bkView.frame.size.width-26, self.bkView.frame.size.height-20)

#define SpecialViewRext00  CGRectMake(self.bkView.frame.origin.x+(self.atLeft?14:11), self.bkView.frame.origin.y+6.0, self.bkView.frame.size.width-26, self.bkView.frame.size.height-20)

#define ImageViewRext00  CGRectMake(self.bkView.frame.origin.x+(self.atLeft?15:11), self.bkView.frame.origin.y+6.0, self.bkView.frame.size.width-26, self.bkView.frame.size.height-20)


#define VoiceViewRect00 CGRectMake(self.bkView.frame.origin.x+(self.atLeft?12.0:8.0), self.bkView.frame.origin.y+(self.atLeft?12.0:12.0), self.bkView.frame.size.width+-(self.atLeft?17.0:20.0), self.bkView.frame.size.height-18-(self.atLeft?12.0:12.0))

#pragma mark-  消息发送状态

#define StatusViewRect  CGRectMake(self.atLeft?(self.bkView.frame.origin.x+self.bkView.frame.size.width-3.0):(self.bkView.frame.origin.x-self.statusView.image.size.width-3.0), self.bkView.frame.origin.y+8.0, self.statusView.image.size.width, self.statusView.image.size.height)

#define  statusImagesArr  @[@"icon_msgfail1.png",@"icon_msgsent1.png",@"icon_msgpend1.png",@"icon_msgread1.png"]

#define  statusWordsArr  @[NSLocalizedString(@"newsState4", nil),NSLocalizedString(@"newsState", nil),NSLocalizedString(@"newsState3", nil),NSLocalizedString(@"newsState1", nil)]

#pragma mark - 提示信息
#define HintsLabelRect  CGRectMake(0, 5,_hintsLabel.frame.size.width, _hintsLabel.frame.size.height)

#endif
